﻿@model MVC.Music.Data.Models.TrackModel
@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>
    Create</h2>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>TrackModel</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.Bitrates)
        </div>
        <div class="editor-field">
            <select id="dropListBitrate">
            </select>
        </div>
        @*<div class="editor-label">
            @Html.LabelFor(model => model.TrackID)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TrackID)
            @Html.ValidationMessageFor(model => model.TrackID)
        </div>*@
        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.CreatedDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CreatedDate)
            @Html.ValidationMessageFor(model => model.CreatedDate)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Lyric)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Lyric)
            @Html.ValidationMessageFor(model => model.Lyric)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.ViettelRingBackToneCode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ViettelRingBackToneCode)
            @Html.ValidationMessageFor(model => model.ViettelRingBackToneCode)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.MobiRingBackToneCode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.MobiRingBackToneCode)
            @Html.ValidationMessageFor(model => model.MobiRingBackToneCode)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.VinaRingBackToneCode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.VinaRingBackToneCode)
            @Html.ValidationMessageFor(model => model.VinaRingBackToneCode)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.DownloadPrice)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DownloadPrice)
            @Html.ValidationMessageFor(model => model.DownloadPrice)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.StreamingPrice)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.StreamingPrice)
            @Html.ValidationMessageFor(model => model.StreamingPrice)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.RingbackSubscriptionPrice)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.RingbackSubscriptionPrice)
            @Html.ValidationMessageFor(model => model.RingbackSubscriptionPrice)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.ListenNumber)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ListenNumber)
            @Html.ValidationMessageFor(model => model.ListenNumber)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.DownloadNumber)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DownloadNumber)
            @Html.ValidationMessageFor(model => model.DownloadNumber)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Duration)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Duration)
            @Html.ValidationMessageFor(model => model.Duration)
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
       @Scripts.Render("~/bundles/jqueryui")
    @Scripts.Render("~/bundles/jqueryuimultiselectwidget")
    <script type="text/javascript">
        jQuery(document).ready(function () {

            jQuery.getJSON("/Bitrate/GetBitrates", null, function (response) {
                // alert(response);
                //jQuery("#dropListYear").fillSelect(response);
                jQuery("#dropListBitrate").addItems(response);
                jQuery('#dropListBitrate').multiselect();
            });

            $.fn.addItems = function (data) {
                return this.each(function () {
                    var list = this;
                    $.each(data, function (index, itemData) {
                        var option = new Option(itemData.Text, itemData.Value);
                        list.add(option);
                    });
                });
            };
        });
           
    </script>
}
